package java_learn.java_jinjie.ThreadAndException;

import java.util.Objects;

/**
 * @Author: 李浩然
 * @Date: 2020/12/7 12:55 下午
 */
public class Demo04Objects {
    public static void main(String[] args) {
        method(null);
    }

    private static void method(Object obj) {
//        if(obj==null){
//            throw new NullPointerException("传递的对象值是空");
//        }
        Objects.requireNonNull(obj, "传递的对象值是null");
        Objects.requireNonNull(obj);
    }

}
